import os
from qianfan import Qianfan
from com.watermelon.rpa.functions import qianfan_config

client = Qianfan(
    access_key=qianfan_config.ACCESS_KEY,
    secret_key=qianfan_config.SECRET_KEY
)

completion = client.chat.completions.create(
    model="ernie-3.5-8k", # 指定特定模型
    messages=[
        {'role': 'system', 'content': '平台助手'},
        {'role': 'user', 'content': '你好'}
    ],
    stream=True
)

for r in completion:
    print(r)
